<?php
//set timezone
$timezone = "Asia/Saigon";
if(function_exists('date_default_timezone_set')){
	date_default_timezone_set($timezone);
}else{
	ini_set("date.timezone", $timezone); 
}

$dir = realpath(dirname(__FILE__));
$homedir = realpath($dir . "/../");
$homepage = "/";
if(basename($homedir) != "htdocs" && basename($homedir) != "public_html"){	
	$dirname = basename($homedir);
	$self = $_SERVER["PHP_SELF"];
	$index = mb_strpos($self, $dirname);
	$homepage = substr($self, 0, $index + strlen($dirname) + 1);
}

//$homedir .= "/";
define('base', $homepage);
//define('base_index', $homepage . "index.php/");
//define('base_index_admin', $homepage . "index.php/admin/");
define('base_index', $homepage);
define('base_index_admin', $homepage . "admin/");
define('base_common', $homepage . "common/");
define('base_common_admin', $homepage . "common/admin/");

$dir = realpath(dirname(__FILE__));
$product_dir = $dir . "/upload/product/";
$product_path = $homepage . "common/upload/product/";
$news_dir = $dir . "/upload/news/";
$news_path = $homepage . "common/upload/news/";

$arr_lang = array("vi" => "Tiếng Việt", "en" => "English");
$arr_visible = array("y" => "Hiện", "n" => "Ẩn");
$arr_yesno = array("y" => "Có", "n" => "Không");

if(@$_SESSION["lang"] == "en" || @$_SESSION["lang2"] == "en"){
	$arr_visible = array("y" => "Visible", "n" => "Invisible");
	$arr_yesno = array("y" => "Yes", "n" => "No");	
}

//form fields
$arr_lang_chk_empty = array("vi");
$main_language = "vi";

$arr_fields_category = array();
$arr_fields_category["categoryName"] = array("title" => $lang["category"]["categoryName"], "arr_attr" => array("class" => "sizem"));
$arr_fields_category["category_url"] = array("title" => $lang["category"]["category_url"], "arr_attr" => array("class" => "sizem"), "required" => false, "note" => $lang["general"]["note_url"]);

$arr_fields_news = array();
$arr_fields_news["newsTitle"] = array("title" => $lang["news"]["newsTitle"], "arr_attr" => array("class" => "sizem"));
$arr_fields_news["news_url"] = array("title" => $lang["news"]["news_url"], "arr_attr" => array("class" => "sizem"), "required" => false, "note" => $lang["general"]["note_url"]);
$arr_fields_news["shortDesc"] = array("title" => $lang["news"]["shortDesc"], "type" => "textarea", "arr_attr" => array("style" => "width:300px;"));
$arr_fields_news["fullDesc"] = array("title" => $lang["news"]["fullDesc"], "type" => "ckeditor");

$arr_fields_product = array();
$arr_fields_product["productName"] = array("title" => $lang["product"]["productName"], "arr_attr" => array("class" => "sizem"));
$arr_fields_product["product_url"] = array("title" => $lang["product"]["product_url"], "arr_attr" => array("class" => "sizem"), "required" => false, "note" => $lang["general"]["note_url"]);
$arr_fields_product["productShortDesc"] = array("title" => $lang["product"]["productShortDesc"], "type" => "textarea", "required" => false, "arr_attr" => array("style" => "width:300px;"));
$arr_fields_product["productDesc"] = array("title" => $lang["product"]["productDesc"], "required" => false, "type" => "ckeditor");

$arr_fields_setting["Name"] = array("title" => $lang["setting"]["Name"], "arr_attr" => array("class" => "sizem"));
$arr_fields_setting["shopName"] = array("title" => $lang["setting"]["shopName"], "arr_attr" => array("class" => "sizem"));
$arr_fields_setting["shopAddress"] = array("title" => $lang["setting"]["shopAddress"], "arr_attr" => array("class" => "sizem"));
$arr_fields_setting["shopShortDesc"] = array("title" => $lang["setting"]["shopShortDesc"], "type" => "textarea", "arr_attr" => array("style" => "width:300px;"));
$arr_fields_setting["shopDesc"] = array("title" => $lang["setting"]["shopDesc"], "type" => "textarea", "arr_attr" => array("style" => "width:300px;"));
$arr_fields_setting["shopKeywords"] = array("title" => $lang["setting"]["shopKeywords"], "type" => "textarea", "arr_attr" => array("style" => "width:300px;"));

//header links
if(function_exists("stripUnicode")){
	$header_link = array();
	$header_link["intro"] = array(stripUnicode("GIỚI THIỆU"), stripUnicode("INTRODUCTION"));
	$header_link["product"] = array(stripUnicode("SẢN PHẨM"), stripUnicode("PRODUCT"));
	$header_link["news"] = array(stripUnicode("TIN TỨC"), stripUnicode("NEWS"));
	$header_link["contact"] = array(stripUnicode("LIÊN HỆ"), stripUnicode("CONTACT"));
}
//image setting
$image_width  = 320;
$image_height = 480;

$image_width_list  = 140;
$image_height_list = 154;

//paging
$news_paging_value = 10;
$product_paging_value = 10;

$website = "www.tramthiennha.com";

//SMTP config
$smtpusername = "";
$smtppassword = "";
$setfrom = array("CHS Quoc Hoc Hue" => "chs@chsquochochue.com");
if(@$_SESSION["lang"] == "en" || @$_SESSION["lang2"] == "en"){
	$setfrom = array("Quoc Hoc Hue Alumni" => "chs@chsquochochue.com");
}

?>